package com.blockchain.securewallet.tools;

import android.content.Context;
import android.content.Intent;

import com.blockchain.securewallet.activities.FAQActivity;
import com.blockchain.securewallet.activities.FAQDetailsActivity;
import com.blockchain.securewallet.activities.UniversalActivity;
import com.blockchain.securewallet.activities.WalletInitActivity;
import com.blockchain.securewallet.activities.WatchSeedActivity;

/**
 * 方便一些重复性需要跳转的界面使用
 * <p>
 * Created by Lopez on 2018/6/10.
 */
public class ActivityLauncher {

    /**
     * 前往创建/回复钱包界面
     *
     * @param context
     * @param isForbidden true则禁止topbar的显示 and 不能关闭当前页面
     */
    public static void gotoWalletInitActivity(Context context, boolean isForbidden) {

        Intent intent = new Intent();
        intent.setClass(context, WalletInitActivity.class);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);

        if (!isForbidden) {
            //这里的value控制WalletInitActivity能否被关闭，仅0表示禁止
            intent.putExtra(WalletInitActivity.KEY_MODULE_FROM, -1);
        }

        context.startActivity(intent);
    }

    /**
     * 前往FAQ界面
     *
     * @param context
     */
    public static void gotoFAQActivity(Context context) {
        Intent intent = new Intent();
        intent.setClass(context, FAQActivity.class);
        context.startActivity(intent);
    }

    /**
     * 前往FAQ界面
     *
     * @param context
     */
    public static void gotoFAQDetailsActivity(Context context, int type) {
        Intent intent = new Intent();
        intent.setClass(context, FAQDetailsActivity.class);
        intent.putExtra(FAQDetailsActivity.type, type);
        context.startActivity(intent);
    }
    
    /**
     * 前往查看种子密码界面
     *
     * @param context
     */
    public static void gotoWatchSeedActivity(Context context) {
        Intent intent = new Intent();
        intent.setClass(context, WatchSeedActivity.class);
        context.startActivity(intent);
    }


}
